﻿<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ page import="nc.vo.sm.UserVO"%>
<%@ page import="nc.bs.ebvp.login.Constant"%>
<%@ page import="nc.bs.ebvp.sourcingcoll.Constants"%>
<%@ page import="nc.bs.ebvppub.ebvpservicefactory.LoadConfigProperty"%>
<%
	String basePath = request.getContextPath();
	String strProjPk = request.getParameter("pkProj");
	String strParaEc021 = (String)request.getSession().getAttribute(Constants.ID_EC021);
	String strParaEc022 = (String)request.getSession().getAttribute(Constants.ID_EC022);
	UserVO userVo = (UserVO)request.getSession().getAttribute(Constant.USER_INFO);
	boolean isClientCa = false;
	boolean isServerCa = false;
	//供应商客户端是否支持CA
	if("Y".equalsIgnoreCase(strParaEc021) || (null != userVo.getIsca() && userVo.getIsca().booleanValue())){
		isClientCa = true;
	}
	//招投标服务器是否支持CA
	if("Y".equalsIgnoreCase(strParaEc022)){
		isServerCa = true;
	}
	//CA厂商名称
	String strCaFactory = (String)request.getSession().getAttribute(LoadConfigProperty.EBVP_CA_FACTORY);
%>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>发邀请函环节应答</title>
		<%if(isClientCa||isServerCa){%>
			<%if(Constants.CA_FACTORY_ITRUS.equals(strCaFactory)){%>
				<script type="text/javascript" src="js/itrusforNC.js"></script>
				<script type="text/javascript" src="js/pta.js"></script>
			<%} else if(Constants.CA_FACTORY_INFOSEC.equals(strCaFactory)){%>
				<script type="text/javascript" src="js/Infosec4NC.js"></script>
			<%} else if(Constants.CA_FACTORY_DEAN.equals(strCaFactory)){%>
				<script type="text/javascript" src="js/DatechJs.js"></script>
			<%} %>
		<%}%>
	</head>
	<body class="fullbody">
		<form action="" method="post" name="replyform">
			<input type="hidden" name="pk_file" />
			<input type="hidden" name="file_name" />
			<input type="hidden" name="casn" value=""/>
			<input type="hidden" name="signature" value=""/>
			<input type="hidden" name="replyTs" value="${REPLY_FORM.replyTs}"/>
			<div class="context">
				<div class="position">
					<div class="tposi">
						当前位置：
						<a href="<%=basePath%>/infopub/pubmain"	class="linkstyle">首页</a> &nbsp;&gt;&gt;&nbsp;
						<a href="<%=basePath%>/sourcing/projlist" class="linkstyle">我的投标\谈判\询价</a> &nbsp;&gt;&gt;&nbsp;
						<a href="<%=basePath%>/sourcing/biddingprojlist" class="linkstyle">进行中的项目</a> &nbsp;&gt;&gt;&nbsp;
						<a href="<%=basePath%>/sourcing/biddingprojlist/projexec?pk_pur_project=<%=strProjPk%>" class="linkstyle">${PURPROJECT_FORM.project_name}</a> &nbsp;&gt;&gt;&nbsp;
						<span class="curposition">邀请函应答</span>
					</div>
					<div class="help">
                  		<a href="javascript:void(null);" onclick="doHelp('<%=request.getContextPath()%>/help/html/YQHYD.html');" class="linkstyle">帮助</a>
              		</div>				
				</div>
				<div class="margin8">
				</div>
				<div class="subpage_title">
					<div class="title_index">
	                     <img src="<%=basePath%>/images/common/dot03.gif" alt="" border="0" />&nbsp;邀请函应答
	                 </div>
				</div>
				<div class="margin20">
	            </div>
				<div class="subpage_bidlist">
					<table width="95%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="13">
								<img src="<%=basePath%>/images/reply/yingda_zbj_001.jpg" width="13" height="76"	border="0" />
							</td>
							<td width="70" background="<%=basePath%>/images/reply/yingda_zbj_002.jpg">
								<img src="<%=basePath%>/images/reply/yingda_z_001.jpg" width="64" height="63" border="0" />
							</td>
							<td width="215" valign="top" background="<%=basePath%>/images/reply/yingda_zbj_002.jpg">
								<table width="215" border="0" cellpadding="0" cellspacing="0" height="62">
									<tr>
										<td height="36" colspan="8" valign="middle" class="f-14-e57c00">
											距离应答截止日期还有
										</td>
									</tr>
									<tr>
										<td width="26" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="day">
										</td>
										<td align="center" class="f-14-b-000000">
											天
										</td>
										<td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="hour">
										</td>
										<td align="center" class="f-14-b-000000">
											时
										</td>
										<td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="minute">
										</td>
										<td align="center" class="f-14-b-000000">
											分
										</td>
										<td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="second">
										</td>
										<td align="center" class="f-14-b-000000">
											秒
										</td>
									</tr>
								</table>
							</td>
							<td width="10" align="left" background="<%=basePath%>/images/reply/yingda_zbj_002.jpg">
								<img src="<%=basePath%>/images/reply/yingda_zbj_004.jpg" width="1" height="57" border="0" />
							</td>
							<td background="<%=basePath%>/images/reply/yingda_zbj_002.jpg" class="f-12-F60000">
								注意：请在应答截止时间前进行应答，超过应答截止时间后进行的应答操作为无效操作！
							</td>
							<td width="13">
								<img src="<%=basePath%>/images/reply/yingda_zbj_003.jpg" alt="" width="13" height="76" border="0" />
							</td>
						</tr>
					</table>
					<table class="replytxt" width="95%" border="0" cellpadding="0" cellspacing="0">
						<tr>
							<td width="128" height="15"></td>
							<td width="176"></td>
							<td width="96"></td>
							<td width="210"></td>
						</tr>
						<tr>
							<td height="35" align="right">
								项目编号：&nbsp;
							</td>
							<td align="left">
								${PURPROJECT_FORM.billno}
							</td>
							<td align="right">
								项目名称：&nbsp;
							</td>
							<td align="left">
								${PURPROJECT_FORM.project_name}
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								邀请函名称：&nbsp;
							</td>
							<td colspan="3" align="left" valign="bottom">
								<div style="height: 20px; overflow: auto;">
									${releaseTitle}
								</div>
							</td>
						</tr>
						<tr>
							<td align="right" valign="top">
								邀请函内容：&nbsp;
							</td>
							<td colspan="3" align="left" valign="bottom">
								<div style="height: auto; overflow: auto;">
									${RELEASE_FORM.releasetxt}
								</div>
							</td>
						</tr>
						<tr>
							<td>
								&nbsp;
							</td>
						</tr>
					</table>
					<table width="95%" border="0" cellpadding="0" cellspacing="0" height="80" class="">
						<tr>
							<td height="25" colspan="5" class="filelabel">
								邀请文件列表
							</td>
						</tr>
						<tr>
							<td valign="middle">
								<table border="0" cellpadding="0" cellspacing="0" class="tableCss" align="center" width="800px">
									<tr class="titleTr">
										<%
											if(!isServerCa){
										%>
												<th width="47px">序号</th>
												<th width="332px">文件</th>
												<th width="68px">大小</th>
												<th width="310px">备注</th>
												<th width="43px" class="th1">下载</th>
										<%
											} else {
										%>
												<th width="47px">序号</th>
												<th width="312px">文件</th>
												<th width="68px">大小</th>
												<th width="287px">备注</th>
												<th width="43px">下载</th>
												<th width="43px" class="th1"><font class="words-blue">验签</font></th>
										<%	
											}	
										%>
									</tr>
									<c:if test="${RELEASE_FILE_FORM != null}">
										<c:forEach items="${RELEASE_FILE_FORM}" var="file">
											<c:if test="${file.index%2==1}">
												<tr border='1' class="contTr-old" style="height: 28px">
											</c:if>
											<c:if test="${file.index%2==0}">
												<tr border='1' class="contTr-even" style="height: 28px">
											</c:if>
											<%--<tr align="center">
												--%>
												<%
													if(!isServerCa){
												%>
													<td class="td1" width="47px">${file.index}</td>
													<td class="td1" width="332px">${file.file_name}</td>
													<td class="td1" width="68px"><span id="fSize">${file.file_size/1024}</span>KB</td>
													<td class="td1" width="310px">${file.file_note}</td>
													<td class="td1" width="43px"><input type="button" class="buttondel" value="下载" onclick="downloadFile('${file.pk_file}','${file.file_name}');" /></td>
												<%
													} else {
												%>
													<td class="td1" width="47px">${file.index}</td>
													<td class="td1" width="312px">${file.file_name}</td>
													<td class="td1" width="68px"><span id="fSize">${file.file_size/1024}</span>KB</td>
													<td class="td1" width="287px">${file.file_note}</td>
													<td class="td1" width="43px"><input type="button" class="buttondel" value="下载" onclick="downloadFile('${file.pk_file}','${file.file_name}');" /></td>
													<td class="td1" width="43px">
														<input name="fileName" type="file" size="5" />
														<input type="button" class="buttondel" value="验签" onclick="verifyFile('${file.signature}','${file.index}');" />
													</td>
												<%
													}
												%>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</td>
						</tr>
					</table>
					<br>
					<table width="95%" border="0" cellpadding="0" cellspacing="0" height="80" class="">
						<tr>
							<td width="80%" height="25" class="filelabel" align="left">
								应答文件列表
							</td>
							<td width="10%" height="25" align="right">
								<input id="onLoad" type="button" class="buttonadd" value="上传应答文件" onclick="uploadFile();" />
							</td>
						</tr>
						<tr>
							<td valign="middle"  colspan="2">
								<table id="bidFileTable" border="0" cellpadding="0" cellspacing="0" class="tableCss" align="center" width="800px">
									<tr class="titleTr">
										<th width="47px">序号</th>
										<th width="332px">文件</th>
										<th width="68px">大小</th>
										<th width="310px">备注</th>
										<%--<th width="5%">下载</th>
										--%>
										<th width="43px" class="th1">删除</th>
									</tr>
									<c:if test="${REPLY_FILE_FORM != null}">
										<c:forEach items="${REPLY_FILE_FORM}" var="file">
											<c:if test="${file.index%2==1}">
												<tr border='1' class="contTr-old" style="height: 28px" id="${file.pk_file}" align="left">
											</c:if>
											<c:if test="${file.index%2==0}">
												<tr border='1' class="contTr-even" style="height: 28px" id="${file.pk_file}" align="left">
											</c:if>
											<%--<tr id="${file.pk_file}" align="left">
												--%>
												<input type="hidden" id="reply_file_real_path" name="reply_file_real_path" value="${file.real_path}"/>
												<td class="td1" width="47px">${file.index}</td>
												<td class="td1" width="332px"><input style="text-align: left" name="reply_file_name" id="reply_file_name" class="textinput5" readonly type="text" value="${file.file_name}" /></td>
												<td class="td1" width="68px"><span id="fSize">${file.file_size/1024}</span>KB<input style="text-align: left" name="reply_file_size" id="reply_file_size" class="textinput5" readonly type="hidden" value="${file.file_size}" /></td>
												<td class="td1" width="310px" style="text-align: left" ><input style="text-align: left" name="reply_file_memo" id="reply_file_memo" class="textinput5" readonly type="text" value="${file.file_note}" /></td>
												<%--<td><input type="button" class="buttondel" value="下载" onclick="downloadFile('${file.pk_file}','${file.file_name}');" /></td>
												--%>
												<td class="td1" width="43px"><input id="onDelete" type="button" class="buttondel" value="删除" onclick="delFile('${file.pk_file}');" /></td>
											</tr>
										</c:forEach>
									</c:if>
								</table>
							</td>
						</tr>
					</table>
					<br>
					<table width="95%" border="0" cellpadding="0" cellspacing="0" class="releasefile" style="border-top:0px solid #FFFFFF">
						<tr>
							<td width="113" height="28" align="left">
								<span class="filelabel">应答信息</span>
							</td>
							<td width="197" align="center">
								&nbsp;
							</td>
							<td width="113" align="center">
								&nbsp;
							</td>
							<td width="187" align="center">
								&nbsp;
							</td>

						</tr>
						<tr>
							<td width=100% height="28" align="left" colspan="4">
								<span align="right">&nbsp;&nbsp;&nbsp;&nbsp;是否参加：</span>
								<span class=redcolor></span>
								<%--<input type="radio" name="is_join" id="is_join_Y" value="Y" <c:if test="${REPLY_FORM.is_join != null && REPLY_FORM.is_join == \"Y\"}">checked</c:if> />是
								<input type="radio" name="is_join" id="is_join_N" value="N" <c:if test="${REPLY_FORM.is_join != null && REPLY_FORM.is_join == \"N\"}">checked</c:if> />否
								--%>
								<input type="checkbox" name="is_join" id="is_join" value="Y" <c:if test="${REPLY_FORM.is_join != null && REPLY_FORM.is_join == \"Y\"}">checked</c:if>/>
							</td>
						</tr>
						<tr>
							<td width="100%" height="28" align="left" colspan="4">
								<span align="right">&nbsp;&nbsp;&nbsp;&nbsp;是否代理：</span>
								<span class="redcolor"></span>
								<%--<input type="radio" name="is_agent" id="is_agent_y" value="Y" onclick="" <c:if test="${REPLY_FORM.is_agent != null && REPLY_FORM.is_agent == \"Y\"}">checked</c:if> />是
								<input type="radio" name="is_agent" id="is_agent_N" value="N" onclick="" <c:if test="${REPLY_FORM.is_agent != null && REPLY_FORM.is_agent == \"N\"}">checked</c:if> />否
								--%>
								<input type="checkbox" name="is_agent" id="is_agent" value="Y" <c:if test="${REPLY_FORM.is_agent != null && REPLY_FORM.is_agent == \"Y\"}">checked</c:if> onclick="setAgentSupplier()"/>
							</td>
						</tr>
						<tr>
							<td width="100%" height="28" align="left" colspan="4">
								<span align="left">代理商名称：</span>
								&nbsp;<input name='agent_name' type='text' id='textfield22' size='65' value="<c:if test="${REPLY_FORM.agent_name != null}">${REPLY_FORM.agent_name}</c:if>" onfocus="select()" />
							</td>
						</tr>
						<tr>
							<td width="40%" height="28" align="left" style="" colspan="1">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;联系人：<span class=redcolor>*</span>
								<input name='agent_person' type='text' id='textfield3' size='16' value="<c:if test="${REPLY_FORM.agent_person != null}">${REPLY_FORM.agent_person}</c:if>" onfocus="select()"/>
							</td>
							<td width="50%" height="28" align="left" style="" colspan="1">
								联系电话：<input name='agent_phone' type='text' id='connect_phone' size='17' value="<c:if test="${REPLY_FORM.agent_phone != null}">${REPLY_FORM.agent_phone}</c:if>" />
							</td>
							</tr>
						<tr>
							<td width="30%" height="28" align="left" style="" colspan="1">
								&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;手机号：<input name='agent_tel' type='text' id='textfield32' size='17' value="<c:if test="${REPLY_FORM.agent_tel != null}">${REPLY_FORM.agent_tel}</c:if>" />
							</td>
							<td width="70%" height="28" align="left" colspan="1">
								电子邮件：<span class=redcolor>*</span>
								<input name='agent_mail' type='text' id='textfield322' size='30' value="<c:if test="${REPLY_FORM.agent_mail != null}">${REPLY_FORM.agent_mail}</c:if>" onfocus="select()"/>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="right" valign="top">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="11%" align="left" valign="top" style="font-size: 12px;">
											&nbsp;&nbsp;&nbsp;&nbsp;承诺说明：<span class=redcolor>*</span>
										</td>
										<td width="89%" align="left">
											<textarea name="promise" id="textarea2" cols="50" rows="6" onfocus="select()"><c:if test="${REPLY_FORM.promise != null}">${REPLY_FORM.promise}</c:if></textarea>
										</td>
									</tr>
									<tr>
										<td width="10%" align="left" valign="top" style="font-size: 12px;">
											&nbsp;&nbsp;&nbsp;&nbsp;应答说明：
										</td>
										<td width="90%" align="left">
											<textarea name="reply_note" id="textarea21" cols="50" rows="6" onfocus="select()" ><c:if test="${REPLY_FORM.reply_note != null}">${REPLY_FORM.reply_note}</c:if></textarea>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<tr>
							<td colspan="4" align="right" valign="top">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<td width="40%" height="28" align="left" style="font-size: 12px;">
										<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;提交人：</span>
										<span><c:if test="${REPLY_FORM.commit_psn_name != null}">${REPLY_FORM.commit_psn_name}</c:if></span>
									</td>
									<td width="60%" height="28" align="left" style="font-size: 12px;">
										<span>提交时间：</span>
										<span><c:if test="${REPLY_FORM.commit_time != null}">${REPLY_FORM.commit_time}</c:if></span>
									</td>
								</table>
							</td>
						</tr>
						<tr><td width="100%" height="28" align="left" style="font-size: 12px; color:red" colspan="4" id="msgLine"></td></tr>
						<tr>
							<td colspan="4" align="right" valign="top">
								<table width="100%" border="0" cellspacing="0" cellpadding="0">
									<td width="113" height="40" align="center">
										&nbsp;
									</td>
									<td width="197" align="right">
										<%--<img src="<%=basePath%>/images/common/botton_submit.jpg" width="60" height="20" border="0" onclick="doReply()" style="cursor: hand" id="submitBtn"/>
										--%><input type="button" class="btnscs" value="提交" onclick="doReply()" id="submitBtn" style="cursor: hand"/>
									</td>
									<td width="187" align="center">&nbsp;</td>
								</table>
							</td>
						</tr>
					</table>		
				</div>
			</div>
		</form>
		<script language="javascript">
			//设置时间控制对象
			var change  = new timechange();
			//设置时间长度
			change.setDistance(${DISMILL});
			//唤醒计算时间的方法
			wakeInterval();
			//提交响应信息
			
			var showMsg = function(msg){
				document.getElementById('msgLine').innerText = msg;
			}
			
			function doReply(){
				var exeStatus = '<%=request.getAttribute("exeStatus")%>';
				if(exeStatus == '3'){
					return;
				}
				var dis = change.getDistance();
				if(dis == 0){
					disabledForm();
					showMsg("已过应答期限，无法提交！");
					return;
				}
				if(!validateRequire()){
					return;
				}
				//证书SN
				<%if(isClientCa){%>
					var strSn = getSN("${USER_CODE}");
					if(strSn == null || strSn == ""){
						showMsg("请插入Key后再进行操作！");
						return;
					}
					document.replyform.casn.value = strSn;
					//方案主键|发布类单据主键|供应商对应用户主键
					var strSignData = "${RELEASE_FORM.pk_release_h}" + "|" + "${USER_ID}";
					//签名
					document.replyform.signature.value = signmessage(strSignData,"${USER_CODE}");
				<%}%>
				document.replyform.action = "<%=basePath%>/sourcing/biddingprojlist/invitereply";
				document.replyform.submit();
			}
			
			//上传文件
			function uploadFile(){
				<%if(isClientCa){%>
					var strSn = getSN("${USER_CODE}");
					if(strSn == null || strSn == ""){
						showMsg("请插入Key后再进行操作！");
						return;
					}
				<%}%>
				var url = "<%=basePath%>/sourcingcoll/fileupload.jsp";
				url = url + "?" + "uploadMode=1";
				url = url + "&" + "userCode="+"${USER_CODE}";
				url = url + "&" + "isNeedAddRow=Y";
				window.open(url,'' ,'width=640,height=350,location=no');
			}
			
			//下载文件
			function downloadFile(pk_file,file_name){
				document.replyform.pk_file.value = pk_file;
				document.replyform.file_name.value = file_name;
				document.replyform.action="<%=basePath%>/ebvpfile/download";
				document.replyform.submit();
			}
			
			//文件验签
			function verifyFile(signature,index){
				var fileName = document.getElementsByName("fileName")[index-1].value
				var ret = verfiyFile(fileName,signature,"${SERVER_CERT}");
				if(ret)
					showMsg("验签成功！");
				else
					showMsg("验签失败！");
			}
			
			//刷新页面
			function refreshPage(){
				var url = "<%=basePath%>/sourcing/biddingprojlist/releaseinviteinfo?pkProj=${RELEASE_FORM.pk_pur_project}"+"&pkProjStep=${RELEASE_FORM.pk_purproj_step}";
				document.location.href = url;
			}
			
			var validateRequire = function(){
				var is_agent = document.getElementsByName('is_agent');
				var agent_name = document.getElementById('textfield22');
				if(is_agent[0].checked){
					if(agent_name.value == null || trim(agent_name.value).length == 0){
						showMsg('请输入代理商名称！');
						agent_name.focus();
						return false;
					}
				}
				var linkman = document.getElementById('textfield3').value;
				var email = document.getElementById('textfield322').value;
				if(linkman == null || linkman.length == 0){
					showMsg('请输入联系人！');
					document.getElementById('textfield3').focus();
					return false;
				}
				if(email == null || email.length == 0){
					showMsg('请输入EMail！');
					document.getElementById('textfield322').focus();
					return false;
				}
				var promise = document.getElementById('textarea2').value;
				//var reply_note = document.getElementById('textarea21').value;
				if(promise == null || promise.length == 0){
					showMsg('请输入承诺说明！');
					document.getElementById('textarea2').focus();
					return false;
				}
				/*
				if(reply_note == null || reply_note.length == 0){
					showMsg('请输入应答说明！');
					document.getElementById('textarea21').focus();
					return false;
				}
				*/
				
				return true;
			}
			
			
			var setTimeAtProjComp = function(){
				var exeStatus = '<%=request.getAttribute("exeStatus")%>';
				if(exeStatus == '3'){
					change.setDistance(0);
					document.getElementById('day').innerText = 0;
					document.getElementById('hour').innerText = 0;
					document.getElementById('minute').innerText = 0;
					document.getElementById('second').innerText = 0;
				}
			}
			
			var afterReplyMsgShow = function(){
				var msg = "${msg}";
				if(msg != null && trim(msg).length != 0){
					if(msg == 'success'){
						msg = '保存成功！';
					}
					showMsg(msg);
				}
			}
			
			var afterReplyHandle = function(){
				var handleResult = '${REPLY_FORM.handleResult}';
				if(handleResult != null){
					if(handleResult == 1 || handleResult == 2){
						disabledForm();
						showMsg('您提交的信息已经进行了处理，不允许再修改提交信息。');
					}
				}
			}
			
			var disabledForm = function(){
				document.getElementById('is_join').disabled = true;
				//document.getElementById('is_join_N').disabled = true;
				document.getElementById('is_agent').disabled = true;
				//document.getElementById('is_agent_N').disabled = true;
				document.getElementById('textfield22').disabled = true;
				document.getElementById('textfield3').disabled = true;
				document.getElementById('textfield32').disabled = true;
				document.getElementById('connect_phone').disabled = true;				
				document.getElementById('textfield322').disabled = true;
				document.getElementById('textarea2').disabled = true;
				document.getElementById('textarea21').disabled = true;
				document.getElementById('submitBtn').onclick = '';
				document.getElementById('onLoad').onclick = '';

				var onDelete = document.getElementById('onDelete');
				if(onDelete != null){
					onDelete.onclick = '';
				}
				
			}
			setTimeAtProjComp();
			afterReplyMsgShow();
			afterReplyHandle();
			
			function addFileRow(pkReleaseFileB,replyFileName,replyFileSize,replyFilePath){
				
				var fileTable = document.getElementById("bidFileTable");
				var rowNo = fileTable.rows.length;
				var row = fileTable.insertRow();
				row.id = rowNo;
				if(rowNo % 2 == 0){
					row.className = 'contTr-even';
					row.style.height = '28px';
					//row.style.border = '1px';
					
				}else if(rowNo % 2 == 1){
					row.className = 'contTr-old';
					row.style.height = '28px';
					//row.style.border = '1px';
				}
				
				//序号
				var cell = row.insertCell();
				cell.align = 'left';
				cell.className = 'td1';
				cell.style.width = '47px';
				cell.innerHTML = "<input type='hidden' id='reply_file_real_path' name='reply_file_real_path' value='"+replyFilePath+replyFileName+"' />"+rowNo;
				
				//应答文件名称
				cell = row.insertCell();
				cell.align = 'left';
				cell.className = 'td1';
				cell.style.width = '332px';
				cell.innerHTML = "<input style='text-align:left' name='reply_file_name' id='reply_file_name' class='textinput5' readonly type='text' value='"+replyFileName+"' />"; 

				//文件大小
				cell = row.insertCell();
				cell.align = 'left';
				cell.className = 'td1';
				cell.style.width = '68px';
				cell.innerHTML = "<div>" + roundTwo(replyFileSize/1024) + "KB</div><input style='text-align:left' name='reply_file_size' id='reply_file_size' class='textinput5' readonly type='hidden' value='"+replyFileSize+"' />";

				//备注
				cell = row.insertCell();
				cell.align = 'left';
				cell.className = 'td1';
				cell.style.width = '310px';
				cell.innerHTML = "<input type='text' name='reply_file_memo' class='memo-edit' style='width:300px'/>";
				
				//下载
				//cell = row.insertCell();
				//cell.align = 'center';
				//cell.innerHTML = "<td width='43px'></td>";
				
				//删除
				cell = row.insertCell();
				cell.align = 'left';
				cell.className = 'td1';
				cell.style.width = '43px';
				cell.innerHTML = "<input type='button' class='buttondel' value='删除' onclick='delFile("+rowNo+")' />";
			}
			
			//删除文件
			function delFile(index){
				var bidFileTable = document.getElementById("bidFileTable");
				if (bidFileTable != null) {
					// 获取报价信息有多少行
					var rows = bidFileTable.rows;
					if (rows != null && rows.length > 0) {
						for ( var pos = 0; pos < rows.length; pos++) {
							var row = rows[pos];
							// 寻找要删除的row
							if (row.id == index) {
								bidFileTable.deleteRow(pos);
								break;
							}
						}
					}
				}
			}
			var roundTwo = function(x) { return Math.round(Math.floor(x * 1000) / 10) / 100; }

			var roundTwo2 = function() {
				var objs = document.getElementsByName('fSize');
				if(objs != null){
					for(var i = 0; i < objs.length; i++){
						if(objs[i].innerText != null && objs[i].innerText.length != 0)
							objs[i].innerText = roundTwo(objs[i].innerText);
					}
				}
			}
			roundTwo2();
			
			var setAgentSupplier = function(){
				var is_agent = document.getElementById('is_agent');
				var textfield22 = document.getElementById('textfield22');
				if(is_agent.checked){
					textfield22.disabled = false;
				}else{
					textfield22.value = '';
					textfield22.disabled = true;
				}
			}
			
			var setAgentSupplierStatus = function(){
				var is_agent = document.getElementById('is_agent');
				var textfield22 = document.getElementById('textfield22');
				if(!is_agent.checked){
					textfield22.disabled = true;
				}
			}
			setAgentSupplierStatus();
		</script>
	</body>
</html>
